#ifndef CButtonHandler_HPP
#define CButtonHandler_HPP

#include <Arduino.h>

class CButtonHandler
{
public:
   CButtonHandler(uint8_t buttonPin);
   
   /**
    * @brief Configures specified Arduino port to be used by Button Switch. 
    * This method should be called from setup() function of your sketch
    */
   void init();
   
   /**
    * @brief Checks if button was pressed/released
    * The idea is to call this method in the main loop (function loop() in your sketch).
    * You will get corresponding enum values if user pressed/released button
    *
    * @return enum value that represents event: press, release, no_event (eButtonEvent value)
    * 
    */
   uint8_t processButton();
private:
   uint8_t        mButtonPin;
   unsigned long  mPressedTime;
   uint8_t        mPreviousState;
   uint8_t        mCurrentState;
};

#endif //CButtonHandler_HPP
